#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
#include<string>
#include<vector>
#include"Vector.h"

void test_vec_1()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	
	/*Vector<int>::iterator it = v1.begin();
	while (v1.end() != it)
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;*/

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
}

void test_vec_2()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.pop_back();
	v1.pop_back();
	v1.pop_back();
	v1.pop_back();

	
	for (auto ch : v1)
	{
		cout << ch << " ";
	}

}


void test_vec_3()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;

	v1.insert(v1.begin(), 10);

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.insert(v1.end(), 10);

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.insert(v1.begin() + 2, 20);

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
}


void test_vec_4()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;

	v1.erase(v1.begin());
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.erase(v1.end() - 1);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.erase(v1.begin() + 1);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;

}



void test_vec_5()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	/*Vector<int>  v2;
	v2.resize(10, 1);
	for (auto ch : v2)
	{
		cout << ch << " ";
	}*/
	
	v1.resize(7, 1);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.resize(2, 1);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
	v1.resize(15, 1);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;
}



void test_vec_6()
{
	Vector<int> v(10, 2);
	for (auto ch : v)
	{
		cout << ch << " ";
	}
	cout << endl;
	/*Vector<string> vv;
	vv.push_back("Aaaaaaaaaaaaaaaa");
	vv.push_back("Aaaaaaaaaaaaaaaa");
	vv.push_back("Aaaaaaaaaaaaaaaa");*/
	
	string s = "aaaaaa";
	Vector<int> vv(s.begin(),s.end());
	for (auto ch : vv)
	{
		cout << ch << " ";
	}
	cout << endl;

}

void test_vec_7()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;

	v1.insert(v1.end(), 10);

	for (auto ch : v1)
	{
		cout << ch << " ";
	}
	cout << endl;


}


void test_vec_8()
{
	Vector<int>  v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	
	Vector<int>::reverse_iterator it = v1.rbegin();
	while (it != v1.rend())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
}

int main()
{
	//test_vec_1();
	//test_vec_2();
	test_vec_8();
}